import request from '@/utils/request';
import store from "@/store";

const env = import.meta.env.MODE || 'development';
const prefix = '';

// 仓库产品库存
// 列表 /apiapp/v1/warehouse_product_stock/list
export function storeProductListListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_stock/list`,
    method: 'get',
    params
  });
}

// 详情 /apiapp/v1/warehouse_product_stock/details
export function storeProductDetailApi (id, params) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_stock/details?id=${id}`,
    method: 'get',
    params
  });
}

// 库存数变动记录 /apiapp/v1/warehouse_product_stock/log
export function storeProductLogApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_stock/log`,
    method: 'get',
    params
  });
}

// 编辑 /apiapp/v1/warehouse_product_stock/edit
export function storeProductEditApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_stock/edit?id=${id}`,
    method: 'post',
    data
  });
}

// 删除 /apiapp/v1/warehouse_product_stock/delete
export function storeProductDeleteApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_stock/delete`,
    method: 'post',
    data
  });
}




// 出入库记录
// 入库列表 /apiapp/v1/warehouse_product_record/rk_list
export function warehousingRecordListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/rk_list`,
    method: 'get',
    params
  });
}

// 新增入库 /apiapp/v1/warehouse_product_record/rk_create
export function warehousingRecordCreateApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/rk_create`,
    method: 'post',
    data
  });
}

// 入库作废 /apiapp/v1/warehouse_product_record/rk_cancel
export function warehousingRecordCancelApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/rk_cancel`,
    method: 'post',
    data
  });
}

// 出库列表 /apiapp/v1/warehouse_product_record/ck_list
export function outboundRecordListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/ck_list`,
    method: 'get',
    params
  });
}

// 新增出库 /apiapp/v1/warehouse_product_record/ck_create
export function outboundRecordCreateApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/ck_create`,
    method: 'post',
    data
  });
}

// 出库作废 /apiapp/v1/warehouse_product_record/ck_cancel
export function outboundRecordCancelApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/ck_cancel`,
    method: 'post',
    data
  });
}

// 调拨列表 /apiapp/v1/warehouse_product_record/db_list
export function DispatchRecordListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/db_list`,
    method: 'get',
    params
  });
}

// 新增调拨 /apiapp/v1/warehouse_product_record/db_create
export function DispatchRecordCreateApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/db_create`,
    method: 'post',
    data
  });
}

// 调拨作废 /apiapp/v1/warehouse_product_record/db_cancel
export function DispatchRecordCancelApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/warehouse_product_record/db_cancel`,
    method: 'post',
    data
  });
}
